﻿using System;
using System.Collections.Generic;
using System.Text;

using Circo.Framework.BusinessLogic;
using Circo.Framework.BusinessLogic.Views.Filters;
using Circo.Framework.BusinessLogic.Views.Order;
using Circo.Framework.BusinessLogic.Handlers;

using SC.eWedding.Data.Entities;
using SC.eWedding.BusinessLogic.Views;


namespace SC.eWedding.BusinessLogic.Handlers
{
    public partial class ConsultaHandler : AbstractHandler
    {
        public static List<ConsultaView> FindBySearchParameters(int idProveedor)
        {
            List<ViewFilter> filtros = new List<ViewFilter>();

            filtros.Add(new ViewCommonFilter("IdProveedor", idProveedor));

            List<ConsultaView> listaViews = new List<ConsultaView>();

            List<ConsultaEntity> listaEntidades = ConsultaEntity.BuscarPorProveedor(Filter.MapViewFiltersToEntityFilters(filtros));

            foreach (ConsultaEntity unaEntidad in listaEntidades)
                listaViews.Add(new ConsultaView(unaEntidad));

            return listaViews;
        }
    }
}
